package cn.doitedu.utils;

import com.alibaba.fastjson.JSON;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.functions.ScalarFunction;

import java.util.HashMap;
import java.util.Map;

public class Map2JsonUDF extends ScalarFunction {

    @DataTypeHint("VARCHAR(200)")
    public String eval(@DataTypeHint("MAP<STRING,STRING>") Map<String,String> properties){

        return JSON.toJSONString(properties);

    }

}
